programming4us
           
 
 
Programming

CSS for Mobile Browsers : Common Patterns (part 3) - Titles and Pseudoclasses

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
12/14/2010 4:08:01 PM
3. Titles

A common approach for low- and mid-end devices is to rely on header tags and CSS to provide a simple solution for title design. The best approach is to define a 100% width, a background color (or image pattern), a top and bottom border, and the padding:

h1 {
width: 90%;
text-align: center;
background-color: red;
color: white;
border-top: 6px solid #500;
border-bottom: 6px solid #500;
padding: 8px 20px;
clear: both;
font-size: larger;
}

In Figure 2, we can see a very simple stylesheet applying some styles to titles without image usage.

Figure 2. With simple CSS we can create nice designs without images (and network latency). We can do more for smartphones, though, as we’ll see in later chapters.


4. Pseudoclasses

The pseudoclasses link, active, focus, and visited are compatible with all XHTML browsers and standards. The question is: when do the pseudoclasses work? Some situations are well known: for example, link is used for not-visited hyperlinks and visited is used if the links are in the previous browsing history.

What about the focus and active pseudoclasses, though? The behavior can vary in browsers with focus-based, cursor-based, and touch-based navigation.

The well-known hover pseudoclass is not available in the WAP CSS standard, but it is compatible with most non-touch devices, assuming a similar behavior to focus. In touch devices, there isn’t a mouseover event; the screen doesn’t detect the finger position until the user taps it (or clicks it).

Some mobile UIs for touch devices implement a two-tap pattern; if we tap once over an element, it will be like a hover effect, and if we tap again, it will be a click. This can be done with JavaScript and event handling.


Warning:

Remember that even if a browser supports a given pseudoclass, it may not work in touch navigation mode.


Table 3 shows the compatibility for pseudoclasses.

Table 3. CSS pseudoclasses compatibility table
Browser/platformlinkvisitedfocusactivehover
SafariYesYesPartialYesNo
Android browserYesNoNoNoYes (using keys)
Symbian/S60YesNoNoNoYes
Nokia Series 40YesYesNoNoYes from 6th edition No before 6th edition
webOSYesNoNoNoNo
BlackBerryYesNoNoNoNo
NetFrontNoNoNoYesNo
Openwave (Myriad)As visitedNoNoNoNo
Internet ExplorerYesYesYesYesNo
Motorola Internet BrowserYesYesNoYesNo
Opera MobileYesYesNoNoYes
Opera MiniYesYesNoNoYes
Other -----------------
- iPad SDK : New Graphics Functionality - The Basic Drawing Architecture
- jQuery 1.3 : Compact forms (part 6)
- jQuery 1.3 : Compact forms (part 5)
- jQuery 1.3 : Compact forms (part 4)
- jQuery 1.3 : Compact forms (part 3)
- jQuery 1.3 : Compact forms (part 2) - AJAX auto-completion
- jQuery 1.3 : Compact forms (part 1) - Placeholder text for fields
- The Art of SEO : Duplicate Content Issues (part 3)
- The Art of SEO : Duplicate Content Issues (part 2) - How Search Engines Identify Duplicate Content
- The Art of SEO : Duplicate Content Issues (part 1) - Consequences of Duplicate Content
- The Art of SEO : Content Optimization (part 2)
- The Art of SEO : Content Optimization (part 1)
- iPad SDK : New Graphics Functionality - Introducing Dudel (part 2)
- iPad SDK : New Graphics Functionality - Introducing Dudel (part 1)
- iPad SDK : New Graphics Functionality - Bezier Paths
- CSS for Mobile Browsers : Where to Insert the CSS (part 2) - Media queries
- CSS for Mobile Browsers : Where to Insert the CSS (part 1) - Media Filtering
- Developing an SEO-Friendly Website : Keyword Targeting (part 4)
- Developing an SEO-Friendly Website : Keyword Targeting (part 3)
- Developing an SEO-Friendly Website : Keyword Targeting (part 2)
 
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us